import axios from "axios"
import { ElMessage } from "element-plus"

const http = axios.create({
  baseURL: "http://127.0.0.1:6080/api",
  timeout: 5000
})

http.interceptors.request.use(config =>{
  return config
})

http.interceptors.response.use(response => {
  return response.data;
}, error => {
  ElMessage.error(error);

  return Promise.reject(error);
});


export default http
